import threading

n = 0

def tack1():
    global n
    for i in range(1000000):
        n += 1
    print('-->tack1中n的值:',n)

def tack2():
    global n
    for i in range(1000000):
        n += 1
    print('-->tack2中n的值:',n)

if __name__ == '__main__':
    th1 = threading.Thread(target=tack1)
    th2 = threading.Thread(target=tack2)

    th1.start()
    th2.start()

    th1.join()
    th2.join()

    print('-->main中n的值:',n)




